package com.yuju.order.enums;

/**
 * Created by jiangp on 2017/12/16.
 */
public enum RoomTypeStatusReturnCodeEnum {
    ROOMTYPESTATUS_RESERVENUM_GET_SUCCESS("yuju-roomtypestatus-1001", "可预订房间数获取成功"),
    ROOMTYPESTATUS_RESERVENUM_GET_FAILURE("yuju-roomtypestatus-1002", "可预订房间数获取失败"),
    ROOMTYPESTATUS_PRICE_GET_SUCCESS("yuju-roomtypestatus-1003", "房型价格获取成功"),
    ROOMTYPESTATUS_PRICE_GET_FAILURE("yuju-roomtypestatus-1004", "房型价格获取失败"),
    ROOMTYPESTATUS_RESERVENUM_VERIFY_SUCCESS("yuju-roomtypestatus-1005", "可预订房间数验证成功"),
    ROOMTYPESTATUS_RESERVENUM_VERIFY_FAILURE("yuju-roomtypestatus-1006", "可预订房间数验证失败");

    private String code;
    private String desc;

    RoomTypeStatusReturnCodeEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static String getDescByCode(String code) {
        for (RoomTypeStatusReturnCodeEnum enume : RoomTypeStatusReturnCodeEnum.values()) {
            if (enume.getCode().equals(code)) {
                return enume.getDesc();
            }
        }

        return "未知枚举类型";
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
